dateStr=`date "+%Y%m%d"`
hive -e "use default;
		insert into table user_info
		select count(click_time) active_num, click_time dateStr
		from(select id,click_time,index
			from(select id,to_date(click_time) click_time,index,
						row_number() over(partition by id order by click_time) as rn
				from user_clicks
				where dt='${dateStr}') tmp1
			where rn=1) tmp2
		group by click_time;"

